/*******************************************************************************
*
*   FILE NAME:
*       GraphicsDeviceManager.h - GraphicsDeviceManager class definition
*
*   DESCRIPTION:
*       Handles the configuration and management of the graphics device.
*
*******************************************************************************/
#pragma once

#include "DepthFormat.h"
#include "Game.h"
#include "GraphicsDevice.h"
#include "SurfaceFormat.h"
#include "Types.h"

class GraphicsDeviceManager
{
public:
    GraphicsDeviceManager( Game& game );
    ~GraphicsDeviceManager( void );

    void ApplyChanges( void );

    GraphicsDevice& GetGraphicsDevice( void );
    SurfaceFormat GetPreferredBackBufferFormat( void );
    uint32 GetPreferredBackBufferHeight( void );
    uint32 GetPreferredBackBufferWidth( void );
    DepthFormat GetPreferredDepthStencilFormat( void );
    boolean IsFullScreen( void );
    boolean IsMultiSamplingPreferred( void );
    boolean IsSynchronizedWithVerticalRetrace( void );

    void SetFullScreen( boolean fullscreen );
    void SetPreferMultiSampling( boolean prefer_multisampling );
    void SetPreferredBackBufferFormat( SurfaceFormat preferred_back_buffer_format );
    void SetPreferredBackBufferHeight( uint32 preferred_back_buffer_height );
    void SetPreferredBackBufferWidth( uint32 preferred_back_buffer_width );
    void SetPreferredDepthStencilFormat( DepthFormat preferred_depth_stencil_format );
    void SetSynchronizeWithVerticalRetrace( boolean vsync );

protected:

private:
    GraphicsDevice& mGraphicsDevice;
    PresentationParameters mPresentationParameters;

    GraphicsDeviceManager( const GraphicsDeviceManager& other );
    GraphicsDeviceManager& operator=( const GraphicsDeviceManager& other );
};
